package cn.iocoder.an.module.business.dal.mysql.faultclassification;

import java.util.*;

import cn.iocoder.an.framework.common.pojo.PageResult;
import cn.iocoder.an.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.an.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.an.module.business.dal.dataobject.faultclassification.FaultClassificationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.an.module.business.controller.admin.faultclassification.vo.*;

/**
 * 故障类型 Mapper
 *
 * @author zzy
 */
@Mapper
public interface FaultClassificationMapper extends BaseMapperX<FaultClassificationDO> {

    default PageResult<FaultClassificationDO> selectPage(FaultClassificationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FaultClassificationDO>()
                .likeIfPresent(FaultClassificationDO::getName, reqVO.getName())
                .eqIfPresent(FaultClassificationDO::getStatus, reqVO.getStatus())
                .likeIfPresent(FaultClassificationDO::getDescription, reqVO.getDescription())
                .orderByDesc(FaultClassificationDO::getId));
    }

}